<!DOCTYPE html>
<html>
<head>
<title>红包方案管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../../include/resources.html">

<script type="text/javascript">
	var dataGrid;
	
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			url : 'newActivityAwardLogList.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'id',
			sortOrder : 'asc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			columns : [ [
				{ field: 'id', title: '编号', width: 50, checkbox : false},
				{ field: 'userName', title: '用户名', width: 100, checkbox : false},
				{ field: 'beInvitedUserName', title: '被邀请人用户名', width: 100, checkbox : false},
				{ field: 'tache', title: '活动环节', width: 100, checkbox : false,
					formatter: function(value,row,index) {
						if(row.tache == 'register') return "注册环节";
						else if(row.tache == 'invite') return '邀请好友环节';
						else if(row.tache == 'tender') return '投标环节';
						else if(row.tache == 'by_month_tender_success') return '按月投标环节';
						else if(row.tache == 'first_tender') return '第一次投标环节';
						else if(row.tache == 'sign') return '签到环节';
						else if(row.tache == 'verify_full_borrow_success') return '满审成功环节';
						else if(row.tache == 'be_accomplished') return '大功告成奖';
						else if(row.tache == 'synthetic_aperture') return '先声夺人奖';
						else if(row.tache == 'gamble_at_high_stakes') return '一掷千金奖';
						else if(row.tache == 'automatic_rebate') return '客户投资自动返利';
					}
				},
				{ field: 'ruleType', title: '规则类型', width: 80, checkbox : false,formatter:
						function(value,row,index){
							if(row.ruleType == 1)
								return "红包";
							else if(row.ruleType == 2)
								return "体验券";
							else if(row.ruleType == 3)
								return "加息券";
							else if(row.ruleType == 4)
								return "抽奖";
							else if(row.ruleType == 5)
								return "电影票";
							else if(row.ruleType == 7)
								return "酒券";
						} },
				{ field: 'ruleName', title: '规则名称', width: 100, checkbox : false},
				{ field: 'count', title: '发放数量', width: 100, sortable: false},
				{ field: 'amount', title: '大小', width: 100, sortable: false},
				{ field: 'addTime', title: '添加时间', width: 150, sortable:false,
		      	  	formatter: function(value,row,index){
		      	  		return getLocalTime(value,4);
					}
				}
			 ] ],
			toolbar : '#toolbar',
			onLoadSuccess : function() {
				$('#searchForm table').show();
				parent.$.messager.progress('close');
			}
		});
	});
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	            	<input type="text"  name="searchName" class="sInput" placeholder="输入用户名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
	            	<a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <form id="showAdw">
            	<ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
		        	<li><span>用户名</span><input type="text" name="userName" autocomplete="off"/></li>
		       		<li><span>被邀请人用户</span><input type="text" name="beInvitedUserName" autocomplete="off"/></li>
		       		<li><span>时间</span><input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" class="searchTime"/>&nbsp;-&nbsp;<input type="text" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" class="searchTime"/></li>
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>

	        </form>
		</div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>